Exemple #1
0
        public void update(GameTime gameTime)
        {
            if (!_paused || _singleStep)
            {
                string      levelUid        = LevelSystem.currentLevelUid;
                EventSystem eventSystem     = _systemManager.getSystem(SystemType.Event) as EventSystem;
                List <int>  circuitEntities = _entityManager.getEntitiesPosessing(levelUid, ComponentType.Circuit);

                for (int i = 0; i < circuitEntities.Count; i++)
                {
                    CircuitComponent circuitComponent = _entityManager.getComponent(levelUid, circuitEntities[i], ComponentType.Circuit) as CircuitComponent;

                    foreach (Gate gate in circuitComponent.circuit.gates)
                    {
                        if (gate.type == "output")
                        {
                            OutputGate outputGate = gate as OutputGate;
                            if (outputGate.postEvent)
                            {
                                GateOutputComponent outputComponent = _entityManager.getComponent(levelUid, outputGate.entityId, ComponentType.GateOutput) as GateOutputComponent;
                                GameEventType       eventType       = outputGate.state ? outputComponent.onEnabledEvent : outputComponent.onDisabledEvent;
                                eventSystem.postEvent(new GameEvent(eventType, outputGate.entityId));
                            }
                            outputGate.postEvent = false;
                        }
                    }
                }
            }
            _singleStep = false;
        }
    private void Start()
    {
        inputGate  = new InputGate();
        outputGate = new OutputGate();
        OnHostSet.Invoke("Host: " + host);
        inputGate.client          = this;
        outputGate.client         = this;
        NetworkDataHandler.client = this;
        NetworkDataHandler.InitializePackages();
        NetworkDataHandler.modelGeometry = modelGeometry;
        //var mat = Matrix4x4.TRS(modelGeometry.position, modelGeometry.rotation, modelGeometry.localScale);
        var mat = Matrix4x4.identity;

        mat.m01 = mat.m02 = mat.m03 = 1;
        mat.m10 = mat.m12 = mat.m13 = 1;
        mat.m20 = mat.m21 = mat.m23 = 1;
        mat.m30 = mat.m31 = mat.m32 = 1;
        var convertMatrix = Matrix4x4.identity; convertMatrix.m00 = -1.0f;

        mat           *= convertMatrix;
        convertMatrix *= mat;

        Debug.Log(convertMatrix);
    }