Наследование: MonoBehaviour
Пример #1
0
 private void Awake()
 {
     lr          = GetComponent <LineRenderer>();
     grappleGun  = GetComponent <GrappleGun>();
     gunRotation = GetComponent <GunRotation>();
     gun         = GetComponent <Gun>();
 }
Пример #2
0
        /// <summary>
        /// Delete the grapple hook.
        /// </summary>
        public void Delete()
        {
            try
            {
                //if (Rope == null)
                //{
                //    return;
                //}

                //if (Character != null)
                //{
                //    Rope.DetachEntity(Character);
                //}

                if (Hook != null)
                {
                    //Rope.DetachEntity(Hook);

                    Hook.Delete();
                }

                if (GrappleGun != null)
                {
                    GrappleGun.Delete();
                }

                //Rope.Delete();
            }
            catch
            {
                // ignored
            }
        }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     character        = GetComponent <Rigidbody>();
     mouseLook        = GetComponent <CustomMouseLook>();
     rotator          = GetComponent <CharacterRotator>();
     sMovement        = GetComponent <SurfaceMovement>();
     grappleGun       = GetComponent <GrappleGun>();
     if (grappleGun)
     {
         grappleGun.controller = this;
     }
     grappled  = false;
     justFired = false;
 }
Пример #4
0
    // private GameObject hookedPrefab;

    void Awake()
    {//must change everything to an array
        MainGunScript = guns[0].GetComponent <GrappleGun>();
        AIgun1Script  = guns[1].GetComponent <AIGun>();
        AIgun2Script  = guns[2].GetComponent <AIGun>();
        AIgun3Script  = guns[3].GetComponent <AIGun>();
        AIgun4Script  = guns[4].GetComponent <AIGun>();
        AIgun5Script  = guns[5].GetComponent <AIGun>();



        _isHooked    = false;
        isAIDropping = false;
        maxTime      = UnityEngine.Random.Range(4, 6);

        if (thisCube == null)
        {
            thisCube = transform;
        }

        spawnLocation = thisCube.transform.position;

        Respawn();
    }
Пример #5
0
 // Use this for initialization
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     character = GetComponent<Rigidbody>();
     mouseLook = GetComponent<CustomMouseLook>();
     rotator = GetComponent<CharacterRotator>();
     sMovement = GetComponent<SurfaceMovement>();
     grappleGun = GetComponent<GrappleGun>();
     if (grappleGun) grappleGun.controller = this;
     grappled = false;
     justFired = false;
 }