public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Enabled.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)MasterStatus;
         hashCode = (hashCode * 397) ^ (StateReason != null ? StateReason.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ProjectionId.GetHashCode();
         hashCode = (hashCode * 397) ^ Epoch.GetHashCode();
         hashCode = (hashCode * 397) ^ Version.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Mode;
         hashCode = (hashCode * 397) ^ (Position != null ? Position.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Progress.GetHashCode();
         hashCode = (hashCode * 397) ^ (LastCheckpoint != null ? LastCheckpoint.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ EventsProcessedAfterRestart;
         hashCode = (hashCode * 397) ^ BufferedEvents;
         hashCode = (hashCode * 397) ^ (CheckpointStatus != null ? CheckpointStatus.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ WritePendingEventsBeforeCheckpoint;
         hashCode = (hashCode * 397) ^ WritePendingEventsAfterCheckpoint;
         hashCode = (hashCode * 397) ^ PartitionsCached;
         hashCode = (hashCode * 397) ^ ReadsInProgress;
         hashCode = (hashCode * 397) ^ WritesInProgress;
         hashCode = (hashCode * 397) ^ (EffectiveName != null ? EffectiveName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ResultStreamName != null ? ResultStreamName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CoreProcessingTime.GetHashCode();
         return(hashCode);
     }
 }
Пример #2
0
    public void Reset()
    {
        // start in fall state
        FSM.ChangeState(FallState);

        // used for bunnyhop avoidance
        JumpKeyReleased = true;

        // reset velocity
        rigidbody.velocity        = Vector3.zero;
        rigidbody.angularVelocity = Vector3.zero;

        // Reset player and objects according to check point
        if (LastCheckpoint == null)
        {
            Debug.Log("Only happens at the start of each level");
            // reset player position
            transform.position = startTransform.position;
        }
        else
        {
            Checkpoint check = LastCheckpoint.GetComponent <Checkpoint>();
            if (check != null)
            {
                check.loadCheckpoint(transform);
            }
            else
            {
                // reset player position
                transform.position = startTransform.position;
            }
        }
    }
Пример #3
0
 private void SaveLastCheckPoint(ResolvedEvent resolvedEvent)
 {
     if (resolvedEvent.OriginalPosition.HasValue)
     {
         using (var client = _clientsManager.GetClient())
         {
             var lastCheckpoint = new LastCheckpoint(resolvedEvent.OriginalPosition.Value);
             client.Set(LastcheckpointKey, lastCheckpoint);
         }
     }
 }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        if (!tutorialCheckpoint) audioSource = GetComponent<AudioSource>();
        savedPOS = gameObject.transform.position;
        savedROT = gameObject.transform.rotation;
        shieldCharge = 0;
        bombCharge = 0;
        hullHealth = 0;

        pData = GameObject.FindGameObjectWithTag("Player").GetComponent<LastCheckpoint>();
        pController = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController> ();
        if (!tutorialCheckpoint) particles = transform.FindChild ("CheckPoint Model").FindChild ("Field Particles");
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     pController = player.GetComponent<PlayerController>();
     savedData = player.GetComponent<LastCheckpoint>();
 }
Пример #6
0
    //Transports the player to the specified coordinates
    //Resets their stats to saved data
    //Usually called by a button in the Canvas UI
    public void reloadCheckP(LastCheckpoint savedData)
    {
        if (paused)
        {
            paused = false;
        }

        if(Time.timeScale != 1.0f)
        {
            Time.timeScale = 1.0f;
        }

        Cursor.visible = false;

        //Teleport Player + Camera
        gameObject.transform.position = savedData.getCheckPOS();
        gameObject.transform.rotation = savedData.getCheckROT();

        GameObject.FindGameObjectWithTag("MainCamera").transform.position = savedData.getCheckPOS();
        GameObject.FindGameObjectWithTag("MainCamera").transform.rotation = savedData.getCheckROT();

        //Reset stats
        currHullIntegrity = savedData.getHealth();
        shield.setCurrShieldCharge(savedData.getShield());
        armorGauge.updateChunks(currHullIntegrity);

        bomb.setUseCharge(0);

        GameObject[] deathLasers = GameObject.FindGameObjectsWithTag("Death Laser");
        if (deathLasers != null)
        {
            foreach (GameObject deathLaser in deathLasers)
            {
                deathLaser.GetComponent<GiantDeathLaserOfDoom>().reset();
            }
        }

        //Overwrite data
        //savePlayer();

        //Turn off turrets + Destroy bullets
        GameObject[] allTurrets, allBullets;
        allTurrets = GameObject.FindGameObjectsWithTag ("Turret");
        allBullets = GameObject.FindGameObjectsWithTag ("Projectile");
        for (int numTurret = 0; numTurret < allTurrets.Length; ++numTurret) {
            allTurrets [numTurret].GetComponent<Turret> ().TurnOff ();
        }

        /*for (int numBullet = 0; numBullet < allBullets.Length; ++numBullet) {
            Destroy(allBullets[numBullet]);
        }*/
    }