public void Init(SpringController controller) { if (_initialized) { return; } _controller = controller; var childPosition = childNode ? childNode.transform.position : transform.position + transform.right * -0.1f; var localChildPosition = transform.InverseTransformPoint(childPosition); _boneAxis = localChildPosition.normalized; _initialRotation = transform.localRotation; _childDistance = Vector3.Distance(transform.position, childPosition); _currTipPos = childPosition; _prevTipPos = childPosition; childNode?.Init(controller); if (sideNodeLeft != null) { _sideDistanceLeft = Vector3.Distance(childPosition, sideNodeLeft.transform.position); } if (sideNodeRight != null) { _sideDistanceRight = Vector3.Distance(childPosition, sideNodeRight.transform.position); } _initialized = true; }
// Use this for initialization void Start() { animator1 = childSpring1.GetComponent <Animator>(); animator2 = childSpring2.GetComponent <Animator>(); springController = springs.GetComponent <SpringController>(); }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); throwingCount = ThrowingCount; throwCount = ThrowCount; rng = new Random(); buttons = new List <int>(); audio = gameObject.GetComponent <AudioSource>(); springController = spring.gameObject.GetComponent <SpringController>(); Flip(); }
void OnEnable() { _instance = (SpringController)target; _bonesProperty = serializedObject.FindProperty("_rootBones"); }
private void SpringTouch(GameObject hit) { SpringController spring = hit.transform.parent.GetComponent <SpringController>(); spring.Activate(); }
// Use this for initialization void Start() { springController = spring.GetComponent<SpringController>(); launchController = launchCrate.GetComponent<LaunchController>(); }
// Use this for initialization void Start() { animator = GetComponent<Animator>(); throwingCount = ThrowingCount; throwCount = ThrowCount; rng = new Random(); buttons = new List<int>(); audio = gameObject.GetComponent<AudioSource>(); springController = spring.gameObject.GetComponent<SpringController>(); Flip (); }
// Use this for initialization void Start() { springController = spring.GetComponent <SpringController>(); launchController = launchCrate.GetComponent <LaunchController>(); }