Exemplo n.º 1
0
    public void LoadHWAssignment(int number)
    {
        loadSequence.ClearSequence();

        fadeImage.gameObject.SetActive(true);

        // Do fade out on loadSequence when we have a fade image
        if (fadeImage != null)
        {
            loadSequence.Property(
                new FFRef <Color>(() => fadeImage.color, (v) => fadeImage.color = v), Color.black, FFEase.E_Continuous, fadeTime);
        }

        loadSequence.Sync();
        loadSequence.Call(LoadLevelByName, "HW" + number);
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        float lightLevel = FindObjectOfType <GlobalLightChecker>().GetTotalLightLevel(transform);

        if ((!mCrying && lightLevel >= 1.5f) || (!mCrying && mGoCryHackSwitch))
        {
            mCrying = true;
            mMyActionList.ClearSequence();
            GetComponent <ExPathFollower>().enabled = false;
            StartCoroutine("GoCry");

            var text = "ScareAway";
            var box  = FFMessageBoard <CustomDialogOn> .Box((string)text);

            CustomDialogOn cdo;
            cdo.tag = (string)text;
            box.SendToLocal(cdo);
        }
        else if ((mCrying && GameMath.DistanceBetween(this, mCryingPlace) <= 3.0f && lightLevel >= 2.5f) || mBeCuredHackSwitch)
        {
            var text = "Rescue";
            var box  = FFMessageBoard <CustomDialogOn> .Box((string)text);

            CustomDialogOn cdo;
            cdo.tag = (string)text;
            box.SendToLocal(cdo);


            // Become human?
            Destroy(this);
        }
    }
Exemplo n.º 3
0
    void SetCursorDelayed(Sprite sprite, Color color, float delay = 0.5f)
    {
        cursorDelaySprite = sprite;
        cursorDelayColor  = color;

        cursorDelaySeq.ClearSequence();
        cursorDelaySeq.Delay(delay);
        cursorDelaySeq.Sync();
        cursorDelaySeq.Call(SetCursorDelayedSeq);
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        Vector3 newAveragePos = new Vector3();
        Vector3 topRight      = new Vector3(float.NegativeInfinity, float.NegativeInfinity);
        Vector3 botLeft       = new Vector3(float.PositiveInfinity, float.PositiveInfinity);

        { // get Average Position
            for (int i = 0; i < targets.Length; ++i)
            {
                newAveragePos += new Vector3(
                    targets[i].position.x,
                    0,
                    targets[i].position.z);


                topRight.x = Mathf.Max(topRight.x, targets[i].position.x);
                topRight.y = Mathf.Max(topRight.y, targets[i].position.y);

                botLeft.x = Mathf.Min(botLeft.x, targets[i].position.x);
                botLeft.y = Mathf.Min(botLeft.y, targets[i].position.y);
            }
            newAveragePos /= 3.0f;
            var forward = Vector3.Normalize(Camera.transform.forward);

            newAveragePos += -forward * 35.0f;
            newAveragePos += offset;
        }

        // Adjust Camera Position
        if ((newAveragePos - targetPosition).magnitude > PositionLeash)
        { // Update movementSequence
            targetPosition = newAveragePos;
            movementSeq.ClearSequence();
            movementSeq.Property(ffposition, targetPosition, FFEase.E_SmoothEnd, AdjustmentTime);
        }

        float cameraSize = Mathf.Clamp(
            Mathf.Max(topRight.x - botLeft.x, topRight.y - botLeft.y),
            MinCameraSize,
            MaxCameraSize) * 0.6f;

        if (Mathf.Abs(cameraSize - targetSize) > SizeLeash)
        { // Update SizeSequence
            targetSize = cameraSize;
            Vector3 scaleSize = new Vector3(
                1.0f + ((targetSize / MinCameraSize) - 1),
                1.0f + ((targetSize / MinCameraSize) - 1),
                1.0f + ((targetSize / MinCameraSize) - 1));

            sizeSeq.ClearSequence();
            sizeSeq.Property(RefCameraSize(), targetSize, FFEase.E_SmoothEnd, AdjustmentTime);
            sizeSeq.Property(ffscale, scaleSize, FFEase.E_SmoothEnd, AdjustmentTime);
        }
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (FindObjectOfType <GlobalLightChecker>().GetTotalLightLevel(transform) >= 0.2)
        {
            if (!GetComponent <ControllerPlayerController>())
            {
                Destroy(gameObject);
            }
            else
            {
                //un grueize
                GetComponent <Collider>().isTrigger = false;
                mConvertMaybe.ClearSequence();
                // change model back to normal
                Destroy(this);
            }
        }

        if (mStunTime >= 0.0f)
        {
            mStunTime -= Time.deltaTime;
        }

        if (mStunTime > 0.0f)
        {
            myRidigBody.velocity = Vector3.zero;
            return;
        }

        if (GameMath.DistanceBetween(this, mTarget) < mStunRange)
        {
            mConvertMaybe.Delay(mMaxStunTime);
            mConvertMaybe.Sync();
            mConvertMaybe.Call(StunFinish);
            mConvertMaybe.Sync();

            this.mStunTime = mMaxStunTime;
            mTarget.GetComponent <ControllerPlayerController>().mStunTime = mMaxStunTime;
        }

        Vector3 movementVector = GameMath.UnitVectorBetween(this, mTarget);

        movementVector *= accelerationSpeed * Time.deltaTime;
        myRidigBody.AddForce(movementVector);
        if (myRidigBody.velocity.magnitude >= maxSpeed)
        {
            myRidigBody.velocity = myRidigBody.velocity.normalized * maxSpeed;
        }

        transform.rotation = Quaternion.AngleAxis(
            Mathf.Atan2(myRidigBody.velocity.x * -1, myRidigBody.velocity.z) * 180 / Mathf.PI
            , Vector3.down);
    }
Exemplo n.º 6
0
    private void OnPlayerMoveAction(ExPlayerMoveAction e)
    {
        // Set position
        transform.position = e.position;
        Vector3 moveDirection = e.moveDirection;

        // clear sequence and add new one, time warp to catup on
        // our game
        MoveSeq.ClearSequence();
        MoveSequenceCall(moveDirection);
        MoveSeq.TimeWarpFrom(e.time);
    }
Exemplo n.º 7
0
    public void Move(int index)
    {
        seq.ClearSequence();
        int currIndex = currentPointNumber;

        currentPointNumber = index;

        if (index >= currIndex)// move forward
        {
            MoveForward();
        }
        else
        {
            MoveBackward();
        }
    }