Пример #1
0
 void SpawnItem(Vector3 worldPositionOfSpawn)
 {
     listOfGO.Insert(0, BasicOWRigidbodyGO.SimplestBoxOWObject(Vector3.one));
     listOfGO[0].tag = "Probe";
     listOfGO[0].GetComponent<Rigidbody>().mass = 0.0001f;
     listOfGO[0].renderer.material.mainTexture = cubeTexture;
     listOfGO[0].transform.position = worldPositionOfSpawn;
 }
Пример #2
0
        void StartGrapple(Transform alvo, float ropeLenght, float ropeStrenght = 0.008f, float friction = 0.00651f)
        {
            grapplePoint = BasicOWRigidbodyGO.SimplestBoxOWObject(Vector3.one);
            grapplePoint.rigidbody.mass   = 0.001f;
            grapplePoint.transform.parent = transform.root;
            grapplePoint.AddComponent <HookAnchor>().HookManager = gameObject.GetComponent <ProbeGrapleMod>();
            grapplePoint.transform.name = "grapplingPointMod";
            grapplePoint.GetComponent <MeshFilter>().mesh = hookMesh;
            grapplePoint.renderer.material.color          = new Color(0.25f, 0.25f, 0.25f, 1f);

            grapleRadius     = ropeLenght;
            originalLenght   = ropeLenght;
            elasticConstant  = ropeStrenght;
            frictionConstant = friction;

            LaunchHook(grapplePoint, modCamera.forward * 5, modCamera.transform.position + modCamera.forward);
            lr.SetVertexCount(2);
            wavPlayer.PlayOneShot(throwClip, 0.7f);
        }