Esempio n. 1
0
 protected override void Start()
 {
     base.Start();
     _collider         = GetComponent <CircleCollider2D>();
     _gyman            = _joint.GetComponentInParent <als_gymnast_ctrl>();
     _other_hand_joint = (_gyman.grab_left == this ? _gyman.grab_right : _gyman.grab_left);
 }
Esempio n. 2
0
        //\this being here will save GC allocs

        // initialization
        void Awake()
        {
            _update_action = new UnityAction[] {
                utils.empty_action,
                update_act__disabled_control,
                update_act__control
            };

            _spine        = transform.Find("SpineM").GetComponent <Rigidbody2D>();
            _spine_circle = _spine.GetComponent <CircleCollider2D>();
            _spine_box    = _spine.GetComponent <PolygonCollider2D>();
            _spine_xform  = _spine.transform;

            roll_grow_pos = roll_pos * roll_grow_speed / roll_radius;

            m_joints = new GymanJoint[13];

            foreach (GymanJoint j in GetComponentsInChildren <GymanJoint>())
            {
                if (j.gameObject.name == "LUArm")
                {
                    m_joints[0] = j;
                }
                else if (j.gameObject.name == "LFArm")
                {
                    m_joints[1] = j;
                }
                else if (j.gameObject.name == "RUArm")
                {
                    m_joints[2] = j;
                }
                else if (j.gameObject.name == "RFArm")
                {
                    m_joints[3] = j;
                }
                else if (j.gameObject.name == "Head")
                {
                    m_joints[4] = j;
                }
                else if (j.gameObject.name == "SpineU")
                {
                    m_joints[5] = j;
                }
                else if (j.gameObject.name == "SpineD")
                {
                    m_joints[6] = j;
                }
                else if (j.gameObject.name == "LThigh")
                {
                    m_joints[7] = j;
                }
                else if (j.gameObject.name == "LCalf")
                {
                    m_joints[8] = j;
                }
                else if (j.gameObject.name == "LFoot")
                {
                    m_joints[9] = j;
                }
                else if (j.gameObject.name == "RThigh")
                {
                    m_joints[10] = j;
                }
                else if (j.gameObject.name == "RCalf")
                {
                    m_joints[11] = j;
                }
                else if (j.gameObject.name == "RFoot")
                {
                    m_joints[12] = j;
                }
            }

            m_grab_left  = LFArm.GetComponent <GymanGrab>();
            m_grab_right = RFArm.GetComponent <GymanGrab>();

            m_foots    = new GymanFoot[4];
            m_foots[0] = LFoot.GetComponent <GymanFoot>();
            m_foots[1] = RFoot.GetComponent <GymanFoot>();

            refresh_update_num();
            body_relax();
            is_user_input = true;

            _current_magic_max_speed = magic_max_speed;
        }