void Update() { if (IsEnabled && Time.time >= _cooldown && IsMaster) { var pickup = PickUpCollection.Instance.GetRandomItemIndex(); var position = GetPosition(); position.y += 1f; _cooldown = Time.time + PickUpInterval.Random; TriLog.Log(PickUpCollection.Instance.GetItem(pickup).name); photonView.RPC("SpawnPickUp", PhotonTargets.All, pickup, position, PhotonNetwork.AllocateViewID()); } }
IEnumerator AddScore() { yield return(new WaitForSeconds(_scoreInterval)); if (_target && _del != null) { var index = _target.Index; TriLog.Log("Player", index, "Add score" + (_scoreRate)); _del(index, _scoreRate); } _cr = StartCoroutine(AddScore()); }
protected override void ExtendedLateUpdate() { if (!IsCasting) { return; } if (Release) { TriLog.Log("Shield up"); PlayerState.SwitchState(PlayerStateMachine.PlayerStates.Idle); Cancel(); } }