万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    Unityによる3Dゲーム開発入門 ―iPhone/Android/Webで実践ゲームプログラミング あと6日!!!

    MonoDevelopの文字サイズ

    文字が大きくなったりするが直し方が分からなかった。(忘れた)
    command+2本指 で上(小さくなる)、下(大きくなる)

    PenelopeのサンプルをBoo移植

    PenelopeのサンプルはJSなのでちびちびBooへ移植します。自分のバックアップを兼ねて載せます。
    全て完了したらAsset Storeに載せようかな?(有料でw)

    ・WaterMovement.boo(水の部分)
    →使い方
     スクリプト自身:waterControllerに適用する
     <Inspector設定>
     Water Surface変数:polySurface398(mainLevelFBXの子)
     Pipe Water変数:polySurface401(mainLevelFBXの子)

    import UnityEngine
    #import System.Collections
    
    public class WaterMovement(MonoBehaviour):
    
        // WaterMovement.js
        // Penelope iPhone Tutorial
        //
        // WaterMovement is not explained in the tutorial, however,
        // is a simple script that animates the textures on two meshes
        public waterSurface as Renderer
        public pipeWater as Renderer
        
        def Update():
            myTime as single = Time.time
            
            // Sin is expensive to use on iPhone, so we use PingPong instead
            //    mover as single= Mathf.Sin( myTime * 0.2f );
            mover as single = (Mathf.PingPong((myTime * 0.20000000298F), 1) * 0.05000000075F)
            waterSurface.material.mainTextureOffset = Vector2(mover, mover)
            pipeWater.material.mainTextureOffset = Vector2(((myTime * 0.20000000298F) % 1.0F), ((myTime * 1.29999995232F) % 1.0F))
    

    ・AnimationSpeed.boo(タイトル画面のカメラの移動スピードのスクリプト
    →使い方
     スクリプト自身:Cameraに適用する
     <Inspector設定>
     Animation Target変数:cameraAnimation
     Speed変数:0.2

    import UnityEngine
    #import System.Collections
    
    public class AnimationSpeed(MonoBehaviour):
    
        # AnimationSpeed.js
        # Penelope iPhone Tutorial
        #
        # AnimationSpeed sets the speed for the default clip of an
        # Animation component. This was used for adjusting the playback
        # speed of the introductory flythrough.
        public animationTarget as Animation
        public speed as single = 1.0F
        
        def Start():
            animationTarget[animationTarget.clip.name].speed = speed
    

    ・FollowTransform.boo(タイトル画面のカメラの移動用のスクリプト
    →使い方
     スクリプト自身:Cameraに適用する
     <Inspector設定>
     Target Transform変数:cameraLocator(cameraAnimationの子)
     FaceForward変数:チェック入れる

    import UnityEngine
    #import System.Collections
    
    public class FollowTransform(MonoBehaviour):
    
        # FollowTransform.js
        # Penelope iPhone Tutorial
        #
        # FollowTransform will follow any assigned Transform and 
        # optionally face the forward vector to match for the Transform
        # where this script is attached.
        
        public targetTransform as Transform
    
        # Transform to follow
        public faceForward = false
    
        # Match forward vector?
        private thisTransform as Transform
    
        def Start():
            # Cache component lookup at startup instead of doing this every frame
            thisTransform = transform
    
        def Update():
            thisTransform.position = targetTransform.position
            
            if faceForward:
                thisTransform.forward = targetTransform.forward
    

    ゾンビカラーメモ

    http://www.kitaq.net/lib/rgb/
    これ便利
    R = 60
    G = 82
    B = 33
    color = "#608233"


    2Dフレームワーク Othello

    http://www.wyrmtale.com/products/unity3d-components/orthello

    試して載せていく。

    Asset StoreでDL→新たにプロジェクト作ってインポート→Orthelloフォルダ内の「-Read-Me」を読む

    ◯ワークフロー情報

    ワークフロー - スプライトを使用して新しいシーンを作成する。

    1.新しいSceneを作成します。
    2.SceneにメインOT(プレハブ)オブジェクトを追加します。
    →おそらくProjectビューにあるOrthello->Objects->OTプレハブ
    3.SceneにSprite(プレハブ)オブジェクトを追加します。
    →おそらくProjectビューにあるOrthello->Objects->Sprites->Animationプレハブ
    4.テクスチャに画像をリンクします。
    5.開始

    ワークフロー - アニメーションのスプライトを使用して新しいシーンを作成する
    (訳注:スペルミスしてた WOKFLOW→WORKFLOW)
    1.新しいSceneを作成します。
    2.SceneにメインOT(プレハブ)オブジェクトを追加します。
    3.SceneにSpriteSheetオブジェクトを追加 - 自動にOT/コンテナに配置されます。
    →おそらくProjectビューにあるOrthello->Objects->Sprites->SpriteSheetプレハブ
    4.(テクスチャ、framesXYなど)ごSpriteSheetを設定する
    5.シーンにアニメーションオブジェクトを追加 - 自動にOT/アニメーションに配置されます
    6.つまたは複数のフレームセットを(スプライトシートにリンク)を追加することにより、アニメーションを設定する
    7.追加シーンにスプライトオブジェクトをアニメーション化しています。
    8.(エディタでアニメーションを選択)、アニメーションするスプライトをリンク

    ヒント:animation progress settingを設定する(ドラッグで)ことでアニメーションをプレビューできます。
    →animation progress settingってどこだ?

    Booでのリストの書き方 Unity

    touches as Touch[] = Input.touches
    

    ↑だめ!

    touches[] as Touch = Input.touches
    

    ↑これもだめ!

    for touch as Touch in Input.touches:
        // do something
    

    やっぱり↑こんな書き方しないとダメなのか?
    http://boo.codehaus.org/Lists+And+Arrays

    touches as List = Input.touches
    

    こうか?しかもArrayとかじゃなくてList。中身がTouchと保証されない気がする。
    →BCE0022: Cannot convert '(UnityEngine.Touch)' to 'Boo.Lang.List'.
    なんだよ!