Exemplo n.º 1
0
        public override void Update(float delta)
        {
            if (_threadWorker == null)
            {
                return;
            }
            if (_playing)
            {
                if (CurrentPosition == AmountOfFrames - 1)
                {
                    MainThreadInvoker.Enqueue(() => Finished?.Invoke());
                    _playing = false;
                    return;
                }

                NextKeyFrame();
            }
            else if (_rewindPlannedPos > 0)
            {
                Rewind?.Invoke(true);
                _currentPosition  = _rewindPlannedPos;
                _rewindPlannedPos = -1;
                _threadWorker?.Enqueue(() =>
                {
                    _data.ShowAt(_actualTimestamps ![_currentPosition], true);
                    Rewind?.Invoke(false);
                });
    //private bool rewinding = false;



    private void Start()
    {
        motor       = GetComponent <Albane_PlayerMotor>();
        animator    = GetComponent <Animator>();
        rewind      = GameObject.FindObjectOfType <Rewind>();
        rewindVideo = GameObject.FindObjectOfType <RewindVideo>();
    }
Exemplo n.º 3
0
 void Awake()
 {
     // Get Components
     rewind = GetComponent <Rewind>();
     sr     = GetComponent <SpriteRenderer>();
     bc2d   = GetComponent <BoxCollider2D>();
 }
Exemplo n.º 4
0
 protected virtual void Start()
 {
     //In child: First it's own specified stuff, then base.Start()
     trscript = GetComponent <Rewind>();
     //assigning values to velX and velY individually in each sub-class
     rigidbody          = GetComponent <Rigidbody2D>();
     velocity           = new Vector2(velX, velY);
     rigidbody.velocity = velocity;
     StartCoroutine(Die());
 }
Exemplo n.º 5
0
    void Start()
    {
        gameMaster = GameMaster.instance;


        rewind = this.GetComponent <Rewind>();
        cam    = Camera.main;
        toGo   = this.transform.position;
        toLook = new Vector3(this.transform.rotation.eulerAngles.x, this.transform.rotation.eulerAngles.y, this.transform.rotation.eulerAngles.z);
    }
Exemplo n.º 6
0
 public void IncreaseRewindValue()
 {
     if (SceneManager.GetActiveScene().name == "Play")
     {
         if (Rewind < 3)
         {
             Rewind++;
         }
         SliderRewind.value = Rewind;
         rewindCounter.text = Rewind.ToString() + "/3";
     }
 }
Exemplo n.º 7
0
    private void Start()
    {
        trscript  = GetComponent <Rewind>();
        rigidbody = GetComponent <Rigidbody2D>();
        int i = 0;

        while (i != 1 && i != -1)
        {
            i = UnityEngine.Random.Range(-1, 2);
        }
        velocity       = new Vector2(speed * i, 0);
        velocityBackup = velocity;
    }
Exemplo n.º 8
0
    void Awake()
    {
        S = this;

        trailPrefab = Resources.Load("Rewind Trail");
        line = ((GameObject)trailPrefab).GetComponent<LineRenderer>();
        rewindAudio = GetComponent<AudioSource>();

        Reset();
        Toggle(false);

        Events.Register<OnPauseEvent>(Pause);
        Events.Register<OnResetEvent>(Reset);
        Events.Register<OnDeathEvent>(Reset);
    }
Exemplo n.º 9
0
    void Start()
    {
        ++count;
        active = false;

        flame = transform.Find("Flame").gameObject;
        flame.SetActive(false);
        altarLight = transform.Find("Torchlight").gameObject;
        altarLight.SetActive(false);

        // Get references to the different ability scripts
        walk = Walk.S;
        teleport = Teleport.S;
        rewind = Rewind.S;
    }
Exemplo n.º 10
0
    void Awake()
    {
        activator = GetComponentInChildren<Activator>();
        eye = GetComponentInChildren<Eye>();
        inventory = GetComponentInChildren<Inventory>();
        lastPositionKeeper = GetComponentInChildren<LastPositionKeeper>();
        head = GetComponentInChildren<Head>();
        cameraPlace = GetComponentInChildren<CameraPlace>();
        undo = GetComponentInChildren<Undo>();
        characterController = GetComponentInChildren<CharacterController>();
        rewind = GetComponentInChildren<Rewind>();
        slowmo = GetComponentInChildren<Slowmo>();
        gravity = GetComponentInChildren<Gravity>();

        all.Add(this);
    }
Exemplo n.º 11
0
 void Awake()
 {
     player = GameObject.FindWithTag("player");
     pc     = player.GetComponent <PlayerControl> ();
     if (Rewind._instance == null)
     {
         Rewind._instance = this;
         _instance.Init();
     }
     else
     {
         if (Rewind._instance != this)
         {
             throw new InvalidOperationException("Cannot have two instances of a Singleton");
         }
     }
 }
Exemplo n.º 12
0
 protected void Start()
 {
     hasShield          = true;
     isRewinding        = false;
     rocketCounter      = 0;
     fps                = 60;
     RewindSecondsLimit = 3;
     Health             = 100;
     Rewind             = 0;
     RewindSeconds      = 3;
     FrameCounter       = 1;
     if (SceneManager.GetActiveScene().name == "Play")
     {
         rocketCounterText.text = rocketCounter.ToString();
         rewindCounter.text     = Rewind.ToString() + "/3";
     }
 }
Exemplo n.º 13
0
    IEnumerator rewindCourtine()
    {
        int counter      = 0;
        int SpareCounter = 0;

        gameObject.GetComponent <Rigidbody2D>().velocity = new Vector2(0.0f, 0.0f);
        while (counter < 60)
        {
            if (oldDataList.Count - counter - 1 >= 0)
            {
                this.Health             = oldDataList[oldDataList.Count - counter - 1].oldHealth;
                this.transform.position = oldDataList[oldDataList.Count - counter - 1].OldPosition;
                this.transform.rotation = oldDataList[oldDataList.Count - counter - 1].OldRotation;
                if (SceneManager.GetActiveScene().name == "Play")
                {
                    SliderHealth.value = Health;
                }
            }
            else
            {
                this.Health             = SpareData[SpareData.Count - SpareCounter - 1].oldHealth;
                this.transform.position = SpareData[SpareData.Count - SpareCounter - 1].OldPosition;
                this.transform.rotation = SpareData[SpareData.Count - SpareCounter - 1].OldRotation;
                if (SceneManager.GetActiveScene().name == "Play")
                {
                    SliderHealth.value = Health;
                }
                SpareCounter++;
            }
            counter++;
            yield return(new WaitForSeconds(0));
        }
        this.gameObject.GetComponent <PlayerController>().SetPlayerActive();
        Rewind = 0;
        if (SceneManager.GetActiveScene().name == "Play")
        {
            SliderRewind.value = Rewind;
            rewindCounter.text = Rewind.ToString() + "/3";
        }
        isRewinding = false;
    }
Exemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     _rewind = gameObject.GetComponent <Rewind>();
 }
Exemplo n.º 15
0
 protected virtual void Start()
 {
     trscript     = GetComponent <Rewind>();
     anim         = gameObject.GetComponent <Animator>();
     lookingRight = true;
 }
Exemplo n.º 16
0
 void Awake()
 {
     rewind   = GetComponent <Rewind>();
     animator = GetComponentInChildren <Animator>();
 }
Exemplo n.º 17
0
 void Awake()
 {
     rewind = GetComponent <Rewind>();
 }
Exemplo n.º 18
0
 void Start()
 {
     // Get Components
     Rotation = Mirror.transform.rotation;
     rewind   = GetComponent <Rewind>();
 }
Exemplo n.º 19
0
 private void Timer_Tick(object sender, EventArgs e)
 {
     mode = true;
     Rewind?.Invoke(this, new EventArgs());
 }
Exemplo n.º 20
0
 void Awake()
 {
     destination = GetComponent <AIDestinationSetter>();
     ai          = GetComponent <AIPath>();
     rewind      = GetComponent <Rewind>();
 }