示例#1
0
 void Start()
 {
     timer = maxTime;
     dontGoThroughThings = GetComponent<DontGoThroughThings> ();
     collisionDetection.OnDeath += DestroySelf;
     AreaEnemySpawner.instance.OnStateChange += DestroySelf;
     ForceManager.instance.OnForceAdded += AddForce;
     ForceManager.instance.OnOutwardForceAdded += AddOutwardForce;
     ForceManager.instance.OnPointForceAdded += AddPointForce;
     ForceManager.instance.OnRotationForceAdded += AddRotationForce;
     ForceManager.instance.OnCollisionSwitch += SwitchCollision;
     ForceManager.instance.projectiles++;
 }
 void Start()
 {
     m_collider       = GetComponent <Collider>();
     m_rgd            = GetComponent <Rigidbody>();
     DGTT             = GetComponent <DontGoThroughThings>();
     singletonHandler = GameObject.FindGameObjectWithTag("SingletonHandler");
     PSF                 = singletonHandler.GetComponent <scr_playerStateFunctions>();
     player              = GameObject.FindGameObjectWithTag("Player");
     m_lineRenderer      = GetComponent <LineRenderer>();
     currentSoarDuration = 0;
     player              = GameObject.FindGameObjectWithTag("Player");
     playerAttach        = player.GetComponent <scr_attachRopeTo>();
     shouldBeDestroyed   = false;
 }
示例#3
0
 void Start()
 {
     m_player = GameObject.FindGameObjectWithTag("Player");
     if (m_player == null)
     {
         print("Couldnt Find Player");
         Destroy(this);
         return;
     }
     pRigidbody = m_player.GetComponent <Rigidbody>();
     pAttach    = m_player.GetComponent <scr_attachRopeTo>();
     DGTT       = m_player.GetComponent <DontGoThroughThings>();
     pInput     = m_player.GetComponent <scr_ThirdPersonUserControl>();
     pMove      = m_player.GetComponent <scr_ThirdPersonCharacter>();
 }
    /*
     * Passes the knifecontroller and parameter spin speed to the knife
     */
    public virtual void Setup(Transform _ownerTransform, WarpLookAheadCollider _lookAhead)
    {
        ownerTransform        = _ownerTransform;
        warpLookAheadCollider = _lookAhead;

        stuckInSurface = false;

        gravShiftVector = Vector3.zero;

        rb = GetComponent <Rigidbody>();
        dontGoThroughThings = GetComponent <DontGoThroughThings>();
        trailRenderer       = GetComponentInChildren <TrailRenderer>();

        // Attach the WarpLookAheadCollider to this knife
        this.PostNotification(AttachLookAheadColliderNotification, this);

        //transform.LookAt(transform.position + _controller.transform.forward, _controller.transform.up); //? <-(why is this question mark here?)
    }