// Use this for initialization private void Start() { Rigidbody2DComponent = GetComponent<Rigidbody2D>(); BallLaunched = false; PixelRotationComponent = GetComponent<PixelRotation>(); }
// Use this for initialization void Awake() { bounceForce = 20f; time2Destroy = 3f; time2Reappear = .9f; flying = false; throwing = false; spearString = "Prefabs/Gear/Spear"; spearTipParentTransform = transform.GetChild (0); spearTipTransform = transform.GetChild (0).GetChild(0); spearTipCollider = spearTipTransform.GetComponent<CircleCollider2D> (); pixelRotationScript = GetComponent<PixelRotation> (); pixelRotationScript.Angle = 0; joyfulstickScript = GameObject.Find ("StickHole").GetComponent<Joyfulstick> (); jaiScript = GameObject.Find ("Jai").GetComponent<Jai> (); jaiTransform = jaiScript.transform; jaiScript.spearScript = GetComponent<Spear>(); joyfulstickScript.spearScript = GetComponent<Spear>(); stockPosition = transform.position - jaiTransform.position; throwAdjustmentVector = new Vector3[]{ new Vector3 (0f, .26f,0f), new Vector3 (0f, .31f,0f) }; }