示例#1
0
    void Start()
    {
        state = (int)State.forward;

        modeSpeedIncrease = 4;
        RayCalculator(modeSpeedIncrease);

        rb = GetComponent <Rigidbody>();
        rb.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;

        blockLayerIndex      = LayerMask.NameToLayer("block");
        blockLayerMask.value = (int)(1 << blockLayerIndex);
        edgeLayerIndex       = LayerMask.NameToLayer("edge");
        uIScript             = FindObjectOfType(typeof(TutUIScript)) as TutUIScript;

        mode             = (int)Mode.normal;
        normalSpeed      = speed.z;
        bulletProofSpeed = speed.z;
        strike           = 0;
        strikeConstant   = 0;
        isOnStrike       = false;

        vibrationInt = PlayerPrefs.GetInt("Vibration", 1);

        if (vibrationInt == 1)
        {
            isVibrationOn = true;
        }
        else
        {
            isVibrationOn = false;
        }

        initialScale   = transform.localScale;
        strecthXAmount = new Vector3(1.8f, 1.2f, 1.8f);

        canCollide  = false;
        collidedNow = false;

        lastPassedBlock = -1;

        energyTot          = (TutorialManager.instance.energyTime) / 3;
        energyDecreaseRate = 10f; // for default
        gainedEnergy       = (TutorialManager.instance.energyTime - energyTot) / 5;

        HittableBlockColor = Color.white;

        //strikeParticleScript = FindObjectOfType(typeof(StrikeParticleScript)) as StrikeParticleScript;

        height = this.transform.position.y;

        pointIndex = 1;

        //enteredCollision = false;
    }
示例#2
0
    public void Start()
    {
        isLevel   = false;
        gunScript = FindObjectOfType(typeof(TutGunScript)) as TutGunScript;

        uIScript = FindObjectOfType(typeof(TutUIScript)) as TutUIScript;

        blockNumber = 3; // aslında 16 tane oluyor ilk blok da olduğu için

        blocks = new GameObject[blockNumber + 1];

        Level = 1;

        gameTime = 0f;

        lastHit = null;

        İnitBlockDist = 100f;

        BlockDistUpdate = 90f; //Distance between block

        points     = 0;
        energyTime = 100f;


        playerLock     = false;
        playerLockTurn = false;
        collid         = false;
        didTurn        = false;

        hollowUpdateDist = BlockDistUpdate * 2; // arada 3 blok için 3 le çarp etc.

        GameObject.FindWithTag("LevelHollows").transform.position = new Vector3(0f, 0f, (hollowUpdateDist * 4) + 180f);

        StartCoroutine(TutorialLoop());
    }