Exemple #1
0
 void Start()
 {
     core         = FindObjectOfType <JellyCore>();
     baseRotation = transform.rotation;
     startPos     = transform.position;
     state        = core.GetComponent <StateManager>();
 }
 void Awake()
 {
     core                    = GetComponentInParent <FlapperCore>().GetComponentInChildren <JellyCore>();
     coreRigidbody           = core.GetComponent <Rigidbody>();
     rigidbody               = GetComponent <Rigidbody>();
     collider                = GetComponent <SphereCollider>();
     rigidbody.drag          = JellyCore.drag;
     baseRotation            = rigidbody.rotation;
     transform.localPosition = Vector3.zero;
     if (!isRoot)
     {
         coreCollider          = core.gameObject.AddComponent <SphereCollider>();
         coreCollider.material = collider.material;
         coreCollider.radius   = collider.radius;
         coreCollider.enabled  = false;
     }
 }