void OnGrabRetractEnd(PlayerGrabber grabber)
    {
        //make something happen
        Transform t = grabber.DetachGrab();

        Object.Destroy(t.gameObject);
    }
Exemple #2
0
 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>();
 }
Exemple #3
0
    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;
    }
Exemple #4
0
    void OnGrabRetractEnd(PlayerGrabber grabber)
    {
        grabber.thePlayer.AddScore(score);

        //make something happen
        grabber.DetachGrab();
        boss.TentacleEaten(this);
    }
Exemple #5
0
    public void OnGrab(PlayerGrabber grabber)
    {
        _playerGrabber = grabber;

        _rigid.isKinematic = true;

        OnCarry();

        if (isServer)
        {
            _objectSync.DisableSync();
        }
    }
Exemple #6
0
    void OnGrabRetractEnd(PlayerGrabberBase grabber)
    {
        //make something happen
        grabber.DetachGrab();

        Release();

        PlayerGrabber pGrabber = grabber as PlayerGrabber;

        if (pGrabber != null)
        {
            pGrabber.Equip(weapon);
        }
    }
Exemple #7
0
    void OnGrabDone(PlayerGrabber grabber)
    {
        if(grabber.thePlayer.action == Entity.Action.die) {
        }
        else {
            grabber.thePlayer.stats.ApplyDamage(-1);
        }

        grabber.Retract(true);
    }
Exemple #8
0
 void OnGrabStart(PlayerGrabber grabber)
 {
     if(stateCallback != null) {
         stateCallback(this, State.Grabbed);
     }
 }
 void Awake()
 {
     mPlayer = GetComponent<Player>();
     mGrabber = GetComponent<PlayerGrabber>();
 }
Exemple #10
0
    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);
    }
Exemple #11
0
 void OnDestroy()
 {
     mGrabber = null;
 }
Exemple #12
0
 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();
    }
Exemple #14
0
 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;
	}
Exemple #17
0
    void OnGrabStart(PlayerGrabber grabber)
    {
        starSprite.color = Color.white;

        mLifeState = LifeState.Grabbed;
        planetAttach.enabled = false;
        fadeEnabled = false;
        mCurBounce = 0;
        InvulnerableOff();
    }
Exemple #18
0
 void Awake()
 {
     mPlayer  = GetComponent <Player>();
     mGrabber = GetComponent <PlayerGrabber>();
 }
Exemple #19
0
    //methods used by grabber

    //called during initialization
    public void Init(PlayerGrabber grabber)
    {
        mGrabber = grabber;

        OnInit();
    }
Exemple #20
0
    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;
    }
Exemple #22
0
 void OnGrabRetractStart(PlayerGrabber grabber)
 {
 }
 protected virtual void OnGrabRetractStart(PlayerGrabber grabber)
 {
     //call proper state as 'grabbed'
 }
Exemple #24
0
    void OnGrabDetach(PlayerGrabber grabber)
    {
        //put back in the world
        transform.parent = EntityManager.instance.transform;

        planetAttach.enabled = true;
        planetAttach.applyGravity = true;
    }
Exemple #25
0
    //methods used by grabber
    //called during initialization
    public void Init(PlayerGrabber grabber)
    {
        mGrabber = grabber;

        OnInit();
    }
Exemple #26
0
    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;
    }
Exemple #27
0
 void OnGrabStart(PlayerGrabber grabber)
 {
 }
Exemple #28
0
 void OnDestroy()
 {
     mGrabber = null;
 }