public static Vector3 AddLocalScale(this Transform transform, ExtensionUtils.Axis iaxis, float fscale)
    {
        switch (iaxis)
        {
        case ExtensionUtils.Axis.AxisX:
            TransformExtensionMethods._vVec.Set(fscale, 0f, 0f);
            break;

        case ExtensionUtils.Axis.AxisY:
            TransformExtensionMethods._vVec.Set(0f, fscale, 0f);
            break;

        case ExtensionUtils.Axis.AxisZ:
            TransformExtensionMethods._vVec.Set(0f, 0f, fscale);
            break;

        case ExtensionUtils.Axis.AxisAll:
            TransformExtensionMethods._vVec.Set(fscale, fscale, fscale);
            break;

        default:
            TransformExtensionMethods._vVec = transform.get_localScale();
            break;
        }
        return(transform.AddLocalScale(TransformExtensionMethods._vVec));
    }
コード例 #2
0
    IEnumerator BackSceneChange(int sceneNo)
    {
        float     speed     = 50.0f;
        float     scale     = 0.015f;
        float     minScale  = 0.9f;
        Transform scene     = SceneList[this.sceneNo].transform;
        Transform nextScene = SceneList[sceneNo].transform;

        nextScene.SetLocalScale(minScale);
        nextScene.position = screenSize.Mul((Vector3.one - nextScene.localScale) / 2);
        nextScene.AddPositionX(-screenSize.x);
        while (scene.localScale.x > minScale)
        {
            scene.AddLocalScale(-scale);
            scene.position = screenSize.Mul((Vector3.one - scene.localScale) / 2);
            yield return(new WaitForEndOfFrame());
        }
        scene.SetLocalScale(minScale);

        while (true)
        {
            scene.position     += Vector3.right * speed;
            nextScene.position += Vector3.right * speed;
            if (scene.position.x >= Screen.width - screenSize.x * (1 - scene.localScale.x) / 2)
            {
                break;
            }
            yield return(new WaitForEndOfFrame());
        }
        nextScene.position = screenSize.Mul((Vector3.one - scene.localScale) / 2);

        yield return(new WaitForSeconds(0.15f));

        while (nextScene.localScale.x < 1.0f)
        {
            nextScene.AddLocalScale(scale);
            nextScene.position = screenSize.Mul((Vector3.one - nextScene.localScale) / 2);
            yield return(new WaitForEndOfFrame());
        }
        nextScene.localScale = Vector3.one;
        nextScene.position   = Vector3.zero;

        Debug.Log("SceneChange Success");

        this.sceneNo = sceneNo;
        scene.gameObject.SetActive(false);
        loadCompliteFlg = false;
        yield return(null);
    }
 public static Vector3 AddLocalScaleZ(this Transform transform, float fz)
 {
     return(transform.AddLocalScale(0f, 0f, fz));
 }
 public static Vector3 AddLocalScaleY(this Transform transform, float fy)
 {
     return(transform.AddLocalScale(0f, fy, 0f));
 }
 public static Vector3 AddLocalScaleX(this Transform transform, float fx)
 {
     return(transform.AddLocalScale(fx, 0f, 0f));
 }
 public static Vector3 AddLocalScale(this Transform transform, Vector3 vscale)
 {
     return(transform.AddLocalScale(vscale.x, vscale.y, vscale.z));
 }
コード例 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="value"></param>
 public static void AddLocalScaleZ(this Transform trans, float value)
 {
     trans.AddLocalScale(0, 0, value);
 }
コード例 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="value"></param>
 public static void AddLocalScaleX(this Transform trans, float value)
 {
     trans.AddLocalScale(value, 0, 0);
 }
コード例 #9
0
 public static void AddLocalScale(this Transform transform, Vector3 vec)
 {
     transform.AddLocalScale(vec.x, vec.y, vec.z);
 }