// Use this for initialization
    void Start()
    {
        // References to stuff.
        handAnimator  = GetComponent <Animator>();
        clickAudio    = GetComponent <AudioSource>();
        img           = GetComponent <RawImage>();
        transpHandler = GameObject.FindObjectOfType <TranspHandler>();
        pt            = transform.parent.transform;
        startTime     = Time.time;

        // Find model.
        model        = GameObject.Find("Hideri_L2D").GetComponent <CubismModel>();
        charAnimator = model.gameObject.GetComponent <Animator>();

        // Get parameters we want to directly controll.
        foreach (CubismParameter p in model.Parameters)
        {
            if (p.Id == "ParamEyeBallX")
            {
                eyeX = p;
            }
            else if (p.Id == "ParamEyeBallY")
            {
                eyeY = p;
            }
            else if (p.Id == "ParamEyeLOpen")
            {
                eyeOpenL = p;
            }
            else if (p.Id == "ParamEyeROpen")
            {
                eyeOpenR = p;
            }
            else if (p.Id == "ParamAngleX")
            {
                paramX = p;
            }
            else if (p.Id == "ParamAngleY")
            {
                paramY = p;
            }
            else
            {
                //...
            }
        }
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        // References to stuff.
        handAnimator  = GetComponent <Animator>();
        img           = GetComponent <RawImage>();
        transpHandler = GameObject.FindObjectOfType <TranspHandler>();
        pt            = transform.parent.transform;
        startTime     = Time.time;

        // Find model.
        model        = GameObject.Find("Nanachi_L2D").GetComponent <CubismModel>();
        charAnimator = model.gameObject.GetComponent <Animator>();

        // Get parameters we want to directly controll.
        foreach (CubismParameter p in model.Parameters)
        {
            if (p.Id == "ParamEyeBallX")
            {
                eyeX = p;
            }
            else if (p.Id == "ParamEyeBallY")
            {
                eyeY = p;
            }
            else if (p.Id == "ParamEyeLOpen")
            {
                eyeOpenL = p;
            }
            else if (p.Id == "ParamEyeROpen")
            {
                eyeOpenR = p;
            }
            else if (p.Id == "ParamAngleX")
            {
                paramX = p;
            }
            else if (p.Id == "ParamAngleY")
            {
                paramY = p;
            }
            else if (p.Id == "ParamNnaaa")
            {
                nnaa = p;
            }
            else if (p.Id == "ParamAngry")
            {
                angry = p;
            }
            else if (p.Id == "ParamSpinEyes")
            {
                eyeSpin = p;
            }
            else if (p.Id == "ParamMoveX")
            {
                moveX = p;
            }
            else
            {
                //...
            }
        }

        // Start click counter.
        InvokeRepeating("CheckClickCount", 0, 2);
    }