コード例 #1
0
    void Start()
    {
        UserCameraPivotSetupper setupper = m_pivot.GetComponent <UserCameraPivotSetupper>();

        setupper.SetLerpTime(m_pivotLerpTime);

        m_charCtrl = m_targetUser.GetComponent <UserCharCtrl>();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        m_lineRenderer.SetWidth(m_lineWidth, m_lineWidth);

        m_costBullet       = this.m_bullet.GetComponent <BulletCtrl>().cost;
        m_costChargeBullet = this.m_bulletBouquet.GetComponent <BulletCtrl>().cost;

        m_pitchAngle = m_minPitchAngle;
        this.transform.Rotate(Vector3.right, m_pitchAngle, Space.Self);

        m_input    = m_parent.GetComponent <UserData>().input;
        m_charCtrl = m_parent.GetComponent <UserCharCtrl>();
    }
コード例 #3
0
    private void SetupUnit(GameObject ctrl, GameObject camera, int index)
    {
        const float SliceWidth   = 0.470f;
        const float SliceHeight  = 0.460f;
        const float SliceOffsetW = 1.0f - (SliceWidth + SliceWidth);
        const float SliceOffsetH = 1.0f - (SliceHeight + SliceHeight);

        Rect[] viewportTable = new Rect[4]
        {
            new Rect(0.0f, SliceHeight + SliceOffsetH,
                     SliceWidth, SliceHeight),
            new Rect(0.0f, 0.0f,
                     SliceWidth, SliceHeight),
            new Rect(SliceWidth + SliceOffsetW, SliceHeight + SliceOffsetH,
                     SliceWidth, SliceHeight),
            new Rect(SliceWidth + SliceOffsetW, 0.0f,
                     SliceWidth, SliceHeight),
        };

        // UserData
        {
            UserData cs = ctrl.GetComponent <UserData>();
            cs.userID = (UserID)index;
        }

        // UserCharCtrl
        {
            UserCharCtrl cs       = ctrl.GetComponentInChildren <UserCharCtrl>();
            Camera       csCamera = camera.GetComponentInChildren <Camera>();
            cs.Edit_SetCamera(csCamera);
            csCamera.rect = viewportTable[index];
        }

        // UserCameraAutoCtrl
        {
            UserCameraAutoCtrl cs = camera.GetComponent <UserCameraAutoCtrl>();
            cs.Edit_SetTargetUser(ctrl.transform);
        }

        // UserNoUI
        {
            UIBillboard[] table    = ctrl.GetComponentsInChildren <UIBillboard>();
            Camera        csCamera = camera.GetComponentInChildren <Camera>();
            foreach (UIBillboard cs in table)
            {
                cs.TargetCamera = csCamera;
            }
        }
    }