void OnGrabRetractEnd(PlayerGrabber grabber) { //make something happen Transform t = grabber.DetachGrab(); Object.Destroy(t.gameObject); }
void Start() { player = FindObjectOfType <Player>(); playerGrabber = FindObjectOfType <PlayerGrabber>(); rigidbody = GetComponent <Rigidbody2D>(); gravityStore = rigidbody.gravityScale; onAirVent = false; resetPosition = transform.position; airVent = null; if (floatingBox) { isMovingOnX = false; xMovementCounter = haltTimer; rigidbody.constraints = RigidbodyConstraints2D.FreezeRotation; if (spawnsFloating) { floatHeightTop = this.transform.position.y + floatDistance; } else { floatHeightTop = this.transform.position.y; } } //text prompt cam = FindObjectOfType <Camera>(); }
public void Start() { pointer = GetComponent <VRTK_Pointer>(); bezierRenderer = GetComponent <VRTK_BezierPointerRenderer>(); straightRenderer = GetComponent <VRTK_StraightPointerRenderer>(); attacker = PlayerController.GetComponent <PlayerAttacker>(); commander = PlayerController.GetComponent <PlayerCommander>(); digger = PlayerController.GetComponent <PlayerDigger>(); flyer = PlayerController.GetComponent <PlayerFlyer>(); grabber = PlayerController.GetComponent <PlayerGrabber>(); mover = PlayerController.GetComponent <PlayerMover>(); summoner = PlayerController.GetComponent <PlayerSummoner>(); mover.PointerRenderer = bezierRenderer; SetPointer(false); pointer.DestinationMarkerHover += (object marker, DestinationMarkerEventArgs args) => { destinationArgs = args; destination = args.destinationPosition; }; controllerEvents = GetComponent <VRTK_ControllerEvents>(); controllerEvents.TriggerPressed += OnTriggerPressed; controllerEvents.TriggerReleased += OnTriggerReleased; controllerEvents.TouchpadPressed += OnTouchpadPressed; controllerEvents.TouchpadReleased += OnTouchpadReleased; }
void OnGrabRetractEnd(PlayerGrabber grabber) { grabber.thePlayer.AddScore(score); //make something happen grabber.DetachGrab(); boss.TentacleEaten(this); }
public void OnGrab(PlayerGrabber grabber) { _playerGrabber = grabber; _rigid.isKinematic = true; OnCarry(); if (isServer) { _objectSync.DisableSync(); } }
void OnGrabRetractEnd(PlayerGrabberBase grabber) { //make something happen grabber.DetachGrab(); Release(); PlayerGrabber pGrabber = grabber as PlayerGrabber; if (pGrabber != null) { pGrabber.Equip(weapon); } }
void OnGrabDone(PlayerGrabber grabber) { if(grabber.thePlayer.action == Entity.Action.die) { } else { grabber.thePlayer.stats.ApplyDamage(-1); } grabber.Retract(true); }
void OnGrabStart(PlayerGrabber grabber) { if(stateCallback != null) { stateCallback(this, State.Grabbed); } }
void Awake() { mPlayer = GetComponent<Player>(); mGrabber = GetComponent<PlayerGrabber>(); }
void OnGrabDone(PlayerGrabber grabber) { Vector3 pos = transform.localPosition; pos.z = 0.0f; transform.localPosition = pos; starSprite.scale = new Vector3(grabScale, grabScale, starSprite.scale.z); glowSprite.scale = new Vector3(grabScale, grabScale, glowSprite.scale.z); grabber.Retract(true); }
void OnDestroy() { mGrabber = null; }
void OnGrabDone(PlayerGrabber grabber) { grabber.Retract(true); }
protected virtual void OnGrabRetractEnd(PlayerGrabber grabber) { grabber.DetachGrab(); planetAttach.enabled = true; //get eaten, let player know grabber.thePlayer.AddScore(score); Release(); }
void OnGrabRetractEnd(PlayerGrabber grabber) { //get eaten }
public void OnGrab(PlayerGrabber grabber) { this.playerGrabber = grabber; }
public void OnGrabRelease(PlayerGrabber playerGrabber) { rb2d.velocity += playerGrabber.GetVelocity(); this.playerGrabber = null; }
void OnGrabStart(PlayerGrabber grabber) { starSprite.color = Color.white; mLifeState = LifeState.Grabbed; planetAttach.enabled = false; fadeEnabled = false; mCurBounce = 0; InvulnerableOff(); }
void Awake() { mPlayer = GetComponent <Player>(); mGrabber = GetComponent <PlayerGrabber>(); }
//methods used by grabber //called during initialization public void Init(PlayerGrabber grabber) { mGrabber = grabber; OnInit(); }
void OnGrabRetractEnd(PlayerGrabber grabber) { //make something happen grabber.DetachGrab(); if(stateCallback != null) { stateCallback(this, State.Eaten); } }
//void OnGrabStart(PlayerGrabber grabber) { //} protected virtual void OnGrabDone(PlayerGrabber grabber) { planetAttach.enabled = false; grabber.Retract(true); action = Entity.Action.grabbed; }
void OnGrabRetractStart(PlayerGrabber grabber) { }
protected virtual void OnGrabRetractStart(PlayerGrabber grabber) { //call proper state as 'grabbed' }
void OnGrabDetach(PlayerGrabber grabber) { //put back in the world transform.parent = EntityManager.instance.transform; planetAttach.enabled = true; planetAttach.applyGravity = true; }
//methods used by grabber //called during initialization public void Init(PlayerGrabber grabber) { mGrabber = grabber; OnInit(); }
void OnGrabThrow(PlayerGrabber grabber) { mLifeState = LifeState.Thrown; fadeEnabled = true; mCurBounce = 0; gameObject.layer = Main.layerPlayerProjectile; mCollideLayerMask = Main.layerMaskEnemyComplex; //compute velocity in planet space Vector2 dir = planetAttach.ConvertToPlanetDir(grabber.head.up); Vector2 throwVel = dir*throwSpeed; if(Mathf.Sign(dir.x) == Mathf.Sign(grabber.thePlayer.planetAttach.planetDir.x)) { throwVel += grabber.thePlayer.planetAttach.velocity; } if(grabber.thePlayer.planetAttach.GetCurYVel() > 0) { throwVel.y += grabber.thePlayer.planetAttach.GetCurYVel(); } planetAttach.velocity = throwVel; }
void OnGrabStart(PlayerGrabber grabber) { }
void OnDestroy() { mGrabber = null; }