void Start() { body = GetComponent <Rigidbody>(); clawControl = claw.GetComponent <ClawControl>(); clawState = ClawState.VERTICAL; }
void CreateClaw() { source.PlayOneShot(GrappleHit, .5f); //claw.AddComponent<AudioSource>(); claw = new GameObject("Claw"); claw.transform.parent = line.transform; claw.tag = "Claw"; ClawControl c = claw.AddComponent <ClawControl>(); c.SetMouseInput(this); BoxCollider b = claw.AddComponent <BoxCollider>(); b.size = new Vector3(0.5f, 0.5f, 0.5f); b.isTrigger = true; }
private void Start() { offset = new Vector3(0.1f, 1.8f, 0.0f); clawGameObject = GameObject.Find("Claw(Clone)/ClawBelka/ClawHolder/Claw/ClawPiston/Head"); students = GameObject.Find("Students").GetComponent <ActivateStudents>(); cntrl = GameObject.FindGameObjectWithTag("Claw").GetComponent <ClawControl>(); head = clawGameObject.GetComponent <Animator>(); clawNeck = GameObject.Find("Claw(Clone)/ClawBelka/ClawHolder/Claw").GetComponent <Animator>(); student = RandStudent(); studentTransform = student.transform; defaultLocation = studentTransform.position; clawTransform = clawGameObject.transform; studentAnimator = student.gameObject.transform.GetChild(1).GetChild(0).gameObject.GetComponent <AnimationControll>(); //destination = GameObject.Find("Destination"); destination = GameObject.Find("Destination(Clone)"); destinationTransform = destination.transform.position; }