コード例 #1
0
    // Init all the variables that needs to be
    private void Init()
    {
        mGameFlow = GameObject.Find ("GameFlow").GetComponent<GameFlow>();
        mGameFlow.PauseSmoke (false);
        mRenderer = GetComponent<SpriteRenderer>();
        mRenderer.color = BASE_COLOR;
        mBody = GetComponent<Rigidbody2D>();
        mToxicity = 0.3f;
        mPrevToxicity = 0.0f;
        mOpacity = 1;
        mTmpOpacity = mOpacity;
        mCurrentSpeed = mSpeed;
        mTmpMaxSpeed = mMaxSpeed;
        mCollectablesCount = 0;
        mInAir = false;
        mIsdead = false;
        mCurrentDirection = DIRECTION_LEFT;
        mGameMusic = GameObject.Find ("GameMusic").GetComponent<GameMusic>();
        mAnimator = GetComponent<Animator>();
        mGameMusic.PlayMusic(GameMusic.Songs.LEVEL);
        mTimerOn = true;
        mTimer = MAX_TIMER;
        mToxicTimerOn = false;
        mToxicTimer = 0.0f;

        mFolder1.enabled = true;
        mFolder2.enabled = true;
        mFolder3.enabled = true;

        mRight = Vector2.right;
        mLeft = -Vector2.right;
    }